﻿using System;
using System.Collections.Generic;
using xxpl1.HTTP.Parser;

namespace xxpl1.HTTP.Runtime
{
    public class HandlerContext
    {
        private readonly HttpRequest request;
        private readonly HttpResponse response;
        private HanlderReult result = HanlderReult.Failed;
        private List<Exception> errors = new List<Exception>();

        public HandlerContext(HttpRequest request, HttpResponse response)
        {
            this.request = request;
            this.response = response;
        }

        public HttpRequest Request
        {
            get { return request; }
        }

        public HttpResponse Response
        {
            get { return response; }
        }

        public HanlderReult Result
        {
            get { return result; }
            set { result = value; }
        }

        public void AddException(Exception e)
        {
            errors.Add(e);
        }
    }
}
